package com.qf.flash.mvp.presenter;

import com.qf.flash.http.HttpManager;
import com.qf.flash.mvp.contract.VerCodeContract;
import com.qf.flashlib.base.BasePresenter;
import com.qf.flashlib.base.BaseSubscriber;
import com.qf.flashlib.util.RxUtils;


/**
 * 获取验证码
 * 2020/3/6 9:35
 */
public class VerCodePresenter extends BasePresenter<VerCodeContract.View> implements VerCodeContract.Presenter {

    @Override
    public void getVerCode(String mobile, int updateType) {
        addSubscription(HttpManager.getInstance().getGsonHttpApi()
        .VER_CODE(mobile, updateType)
        .compose(RxUtils.handleResult())
                .compose(RxUtils.io_main())
                .subscribeWith(new BaseSubscriber<Object>(mRootView) {
                    @Override
                    public void onSuccess(Object o) {

                    }
                })
        );
    }
}
